CREATE TABLE [dbo].[tb_CamposDeFormulario]
(
[idCampoDeFormulario] [int] NOT NULL IDENTITY(1, 1),
[NumeroDeOrden] [int] NOT NULL,
[idFormulario] [int] NOT NULL,
[Nombre] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Tipo] [int] NOT NULL,
[AdmiteNulos] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Valores] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TablaValores] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CampoValores] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_CamposDeFormulario] ADD CONSTRAINT [PK_tb_CamposDeFormulario] PRIMARY KEY NONCLUSTERED  ([idCampoDeFormulario]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_CamposDeFormulario] WITH NOCHECK ADD CONSTRAINT [FK_tb_CamposDeFormulario_tb_Formularios] FOREIGN KEY ([idFormulario]) REFERENCES [dbo].[tb_Formularios] ([idFormulario])
GO
ALTER TABLE [dbo].[tb_CamposDeFormulario] WITH NOCHECK ADD CONSTRAINT [FK_tb_CamposDeFormulario_tb_TiposDeDatos] FOREIGN KEY ([Tipo]) REFERENCES [dbo].[tb_TiposDeDatos] ([IdTipoDeDato])
GO
